# 导入:
from django.conf import settings

from zmeiduo.utils.secret import SecretOauth


# 2.生成激活链接
def generate_verify_email_url(request):
    # 1.user_id email
    data_dict = {
        'user_id': request.user.id,
        'email': request.user.email
    }
    # 2.将参数加密
    dumps_data = SecretOauth().dumps(data_dict)

    # 3.拼接 完整的激活路由
    verify_url = settings.EMAIL_VERIFY_URL + dumps_data

    return verify_url